5. Data Packets & PROTOCOLS

Data Packets
They are the building blocks of the network. A packet is a basic unit of communication.
A packet is also called

depending on the protocol used for data transmission.

Before data is transmitted, it is broken into smaller structures of data (packets).They are reassembled to the original data chunk after reaching their destination.

The structure of a packet depends on the type of packet and on the protocol.A packet has a header and a payload.

Header - It keeps overhead information about the packet, the service, and other transmission-related data.These include:

7456db4b52dc81d45c5a0c70399ca12d.png

Payload - is the bulk or body of the packet and carries the actual data.

If a packet is fixed-length, then the payload may be padded with blank information to make it the right size.

d5a5be304ba31caf19992e4225735eaf.png

Trailer - also called the footer, typically contains a couple of bits that tell the receiving device that it has reached the end of the packet. It may also have some type of error checking.

This method of breaking data into smaller pieces (packet) and transmitting it over the network is called packet switching.

The IP packets travel over the internet through nodes (devices and routers) found on the way from the source to the destination. At each node, the router decides to which neighboring node it is more efficient to send the packet.


Packet Sniffer/Network Monitors/Protocol Analyzers

Packet sniffing means capturing data packets flowing across a computer network. The software or device used to do this is called a packet sniffer.

a6cdd8b0e8cf53e11522976bfea3d35b.png

Attackers can use it for:

Countermeasure:


PROTOCOLS

A protocol is a standard set of rules that allow electronic devices to communicate with each other. These rules include what type of data may be transmitted, what commands are used to send and receive data, and how data transfers are confirmed.
It is like a spoken language. If two hardware devices support the same protocol, they can communicate with each other. There are different Protocols for several applications.
Example:

The Internet protocol suite(TCP/IP), which is used for transmitting data over the Internet, contains dozens of protocols. These protocols may be broken up into four catagories:

Ex: UDP Encapsulation

367cef06641e3aa62b1ee13b40058afa.png


Internet Control Message Protocol (ICMP)
It is used by network devices to diagnose network communication issues,to determine whether or not data is reaching its intended destination in a timely manner. It’s primary purpose is error reporting.

The two most common troubleshooting tools that utilize ICMP are:

  1. Traceroute command is used to discover the routes that packets actually take when traveling to their destination. Traceroute will not only identify each router the packet has been forwarded through, but will also measure the delay experienced at each router hop.The journey between one router and another is known as a ‘hop’

How Traceroute works?

cc73f56b2f34125114a62884101c5318.png

1affe8b9eded2b4c4de7f7ce234a7e90.png

47e3c990feb7354719dedc0607f6ab9f.png

6231052a078986c5cd12727b67d2afd0.png

  1. Ping - The ping utility is a simplified version of traceroute,use to test speed of the connection.(<30ms - fast, 30-50ms -average).It also tell us about packet loss.It utilizes the Echo Request and Echo Reply ICMP messages to determine if an IP address is reachable and responding. Unfortunately network attacks can exploit this process,such as the ICMP Flood Attack and the Ping of Death attack.

How ping works?
The ping command first sends an echo request packet to an IP address, then waits for a reply. The ping is successful only if:

47c1dffd80ecff7bfbb8f5549f7ad270.png